SUBROUTINE err_open(err,msg) 
! Copyright (C) 2009-2010 W. Wang 
! License: This file is distributed under the terms of the GNU General Public License.
! Description: ! 
! Revision histoty: Created May 2010  
! Input/output Parameters: 

IMPLICIT NONE
!Local variables  
INTEGER :: err
CHARACTER(100) :: msg
IF (err.GT.0) THEN
  WRITE(*,*)
  WRITE(*,'("Error opening file: ",10A)')TRIM(msg)
  WRITE(*,*)
  STOP
END IF

RETURN
END SUBROUTINE
